<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>订单基本信息</title>
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <%@include file="/WEB-INF/pages/common/common.jsp" %>
    <style type="text/css">
        .popover {
            max-width: 500px;
            width: auto;
        }
    </style>

</head>
<body style="overflow-x: hidden">
<form id="detailForm">
    <div class="row-fluid box">
        <div class="span12 box-header">
            <div class="title span12">
                <div style="float:left">
                    <i class="icon-edit" style="color: #00F;">
                    </i>
                    <strong>订单基本信息</strong>
                </div>
                <%--<div style="float:left;padding-left:20px;font-size: 12px">--%>
                <%--<span><i class="icon-bookmark text-red"></i>报关状态: </span>--%>
                <%--<span style="cursor: pointer"--%>
                <%--id="sendStatusC">${empty orderHead.sendStatusCName ? '暂无' : orderHead.sendStatusCName}</span>--%>
                <%--<span><i class="icon-bookmark text-blue"></i>报检状态: </span>--%>
                <%--<span style="cursor: pointer"--%>
                <%--id="sendStatusI">${empty orderHead.sendStatusIName ? '暂无' : orderHead.sendStatusIName}</span>--%>
                <%--</div>--%>
                <div style="float:right">
                    <button class="btn btn-primary btn-small" type="button" onclick="javascript:history.go(-1)">
                        <i class="fa fa-reply"></i>返回
                    </button>
                </div>
            </div>
        </div>
        <div class="span12 box-content">
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            订单编号
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${orderHead.orderId}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            进出口类型
                        </td>
                        <td class="tdCss">
                            <ui:tsingletableautocomplete
                                    keyFieldName="ieFlag"
                                    valueFieldName="ieFlagXXXX"
                                    tableName="DICT_ITEM"
                                    key="ITEM_KEY"
                                    value="ITEM_VALUE"
                                    groupId="ieType"
                                    defaultKey="${orderHead.ieFlag}"
                                    defaultValue=""/>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            贸易方式
                        </td>
                        <td class="tdCss">
                            <ui:tsingletableautocomplete
                                    keyFieldName="tradeMode"
                                    valueFieldName="tradeModeXXXX"
                                    tableName="DICT_ITEM"
                                    key="ITEM_KEY"
                                    value="ITEM_VALUE"
                                    groupId="TRADE_MODE_QDC"
                                    defaultKey="${orderHead.tradeMode}"
                                    defaultValue=""/>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            商户代码
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${orderHead.ebCode}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss120">
                            商户名称
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${orderHead.ebName}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            商品总价
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${orderHead.totalPayment}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            币制
                        </td>
                        <td class="tdCss">
                            <ui:tautocomplete keyFieldName="currCode"
                                              valueFieldName="currCodeXXX"
                                              tableName="S_CURRENCY_E"
                                              custInspFlag="C"
                                              relateKeyFieldName=""
                                              relateValueFieldName=""
                                              defaultKey="${orderHead.currCode}"
                                              defaultValue=""
                                    />
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            买方名称
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${orderHead.buyerName}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            买方证件类型
                        </td>
                        <td class="tdCss">
                            <ui:tsingletableautocomplete
                                    keyFieldName="buyerCertType"
                                    valueFieldName="buyerCertTypeXXXX"
                                    tableName="DICT_ITEM"
                                    key="ITEM_KEY"
                                    value="ITEM_VALUE"
                                    groupId="idType"
                                    defaultKey="${orderHead.buyerCertType}"
                                    defaultValue=""/>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            买方证件号
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${orderHead.buyerCertId}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            贸易国别
                        </td>
                        <td class="tdCss">
                            <ui:tsingletableautocomplete
                                    keyFieldName="buyerCountry"
                                    valueFieldName="buyerCountryXXXX"
                                    tableName="S_NATIONS"
                                    key="NATIONCO"
                                    value="NATIONCN"
                                    defaultKey="${orderHead.buyerCountry}"
                                    defaultValue=""/>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            买方电话
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${orderHead.buyerTel}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            收货地址
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${orderHead.deliveryAddr}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            电商平台代码
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${orderHead.ebPlatId}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span12">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            备注
                        </td>
                        <td class="tdCss">
                            <textarea rows="3" name="note" style="width: 100%;">${orderHead.note}</textarea>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            入库时间
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${orderHead.createTime}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="span12" style="margin-top: 10px">
            <div class='responsive-table'>
                <table id="goodsList" style="height: 1px">
                </table>
            </div>
        </div>

        <div class="span12" style="margin-top: 10px">
            <div class='responsive-table'>
                <table id="waybillList" style="height: 1px">
                </table>
            </div>
        </div>
    </div>
</form>
<script type="text/javascript">

    $(function () {

        $("#goodsList").jqGrid({
            datatype: "jsonstring",
            datastr: '${goodsListJSON}',
            colNames: ['序号', '商品编码', '商品名称', '商品描述', '规格型号', '数量', '计量单位', '单价', '币制',  '备注'],
            colModel: [
                {name: 'gNo', index: 'gNo', width: 40},
                {name: 'codeTs', index: 'codeTs', width: 100},
                {name: 'gName', index: 'gName', width: 100},
                {name: 'gDesc', index: 'gDesc', width: 100},
                {name: 'gModel', index: 'gModel', width: 100},
                {name: 'gNum', index: 'gNum', width: 100},
                {name: 'gUnitDisplay', index: 'gUnitDisplay', width: 100},
                {name: 'price', index: 'price', width: 100},
                {name: 'currCodeDisplay', index: 'currCodeDisplay', width: 100},
                {name: 'note', index: 'note', width: 100}
            ],
            caption:"订单商品信息列表",
            viewrecords: true, // show the current page, data rang and total records on the toolbar
            height: 'auto',
            autowidth: true,
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            width: $('body').width(),
//            pager: "#orderBodyPage", //分页工具栏

            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });

        $("#waybillList").jqGrid({
            datatype: "jsonstring",
            datastr: '${waybillListJSON}',
            colNames: ['运单号','物流公司代码'],
            colModel: [
                {name: 'waybillId', index: 'waybillId'},
                {name: 'logiEnteCode', index: 'logiEnteCode'}
            ],
            caption:"订单运单信息列表",
            viewrecords: true, // show the current page, data rang and total records on the toolbar
            height: 'auto',
            autowidth: true,
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            width: $('body').width(),
//            pager: "#orderBodyPage", //分页工具栏

            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });

        $(window).resize(function(){
            $("#waybillList,#goodsList").setGridWidth($(".responsive-table").parent().width() * 0.98);
        });
        $("#detailForm input,textarea").attr("disabled", true);
    });


</script>
</body>
</html>
